home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
source code vol 1.adf
/
STARROUTS
/
3DSTARS.S
next >
Wrap
Text File
|
1999-09-26
|
5KB
|
248 lines
org $40000
load $40000
execbase = 4
forbid = -132
permit = -138
bitplane = $60000
j: bsr.S clear_bitplanes
move.l execbase.W,a6
jsr forbid(a6)
lea $dff000,a6
lea coplist(pc),a0
move.l a0,$0080(a6)
clr.w $0088(a6)
move.w #$0020,$0096(a6)
bsr.S prepare_starmovement
main_loop:
cmp.b #$ff,$dff006
bne main_loop
bsr.S move_stars
btst #6,$bfe001
bne.S main_loop
move.l 4,a5
move.l 156(a5),A1
move.l 38(A1),$0080(a6)
move.w #$8020,$0096(a6)
move.l execbase.W,a6
jsr permit(a6)
rts
clear_bitplanes:
lea bitplane,a0
move.w #$5dbf,d0
clear_loop:
clr.b (a0)+
dbf d0,clear_loop
rts
prepare_starmovement:
move.w #$a00,d6
move.l #$00fff000,rnd1
lea pos_control(pc),a2
lea retter,a1
prepare_loop:
bsr.L get_a_new_star
move.l #bitplane,$00(a1,d6.W)
move.l #$6,$04(a1,d6.W)
sub.w #$0020,d6
bne.S prepare_loop
lea CMPundCOLOR(pc),a4
rts
move_stars:
move.w #$a00,d6
move_loop:
move.l 0(a1,d6.W),a0
move.l 4(a1,d6.W),d0
bclr d0,(a0)
bclr d0,$1f40(a0)
bclr d0,$3e80(a0)
goon: bsr.L do_move
bsr.L compute_adress
move.l a0,0(a1,d6.W)
move.l d0,4(a1,d6.W)
move.l 8(a2,d6.W),d4
lsr.w #1,d4
bcc.S not_set1
bset d0,(a0)
not_set1:
lsr.w #1,d4
bcc.S not_set2
bset d0,$1f40(a0)
not_set2:
lsr.w #1,d4
bcc.S not_set3
bset d0,$3e80(a0)
not_set3:
sub.w #$0020,d6
bne.S move_loop
rts
restoreadder:
lea bitplane,a0
add.l #$1f40/2,a0
add.l #20,a0
move.l #78,d0
move.l #2,d1
loop1:
move.l d1,d2
loop2:
clr.b -(a0)
clr.b $1f40(a0)
clr.b $1f40*2(a0)
dbra d2,loop2
move.l d1,d2
loop3: sub.l #40,a0
clr.b (a0)
clr.b $1f40(a0)
clr.b $1f40*2(a0)
dbra d2,loop3
move.l d1,d2
add.l #1,d2
loop5: clr.b (a0)+
clr.b $1f40(a0)
clr.b $1f40*2(a0)
dbra d2,loop5
move.l d1,d2
add.l #1,d2
loop6: add.l #40,a0
clr.b (a0)
clr.b $1f40(a0)
clr.b $1f40*2(a0)
dbra d2,loop6
add.l #2,d1
dbra d0,loop1
move.l #0,adder
rts
do_move:move.l 12(a2,d6.W),d3
move.l 16(a2,d6.W),d4
add.l 0(a2,d6.W),d3
add.l 4(a2,d6.W),d4
tst.l d3
bmi.L get_a_new_star
tst.l d4
bmi.L get_a_new_star
cmp.l #$01400000,d3
bge.L get_a_new_star
cmp.l #$00c80000,d4
bge.L get_a_new_star
move.l d3,0(a2,d6.W)
move.l d4,4(a2,d6.W)
move.l 20(a2,d6.W),d3
move.l 24(a2,d6.W),d4
add.l 8(a1,d6.W),d3
add.l 12(a1,d6.W),d4
move.l d3,8(a1,d6.W)
move.l d4,12(a1,d6.W)
move.l 28(a2,d6.W),d5
move.l 0(a4,d5.L),d1
cmp.l d1,d3
bge.S new_speed_and_color
cmp.l d1,d4
ble.S end_move_star
new_speed_and_color:
move.l 20(a2,d6.W),d0
move.l 24(a2,d6.W),d1
lsr.l #1,d0
move.l d0,d2
asl.l #1,d0
add.l d2,d0
lsr.l #1,d1
move.l d1,d2
asl.l #1,d1
add.l d2,d1
move.l 64(a4,d5.L),d2
move.l d2,8(a2,d6.W)
add.l #4,28(a2,d6.W)
move.l d0,20(a2,d6.W)
move.l d1,24(a2,d6.W)
new_position:
move.l 20(a2,d6.W),d0
move.l d0,12(a2,d6.W)
move.l 24(a2,d6.W),d0
move.l d0,16(a2,d6.W)
btst #1,20(a1,d6.W)
beq.S not_negative
not.l 12(a2,d6.W)
not_negative:
btst #2,20(a1,d6.W)
beq.S end_move_star
not.l 16(a2,d6.W)
end_move_star:
rts
get_a_new_star:
clr.l 28(a2,d6.W)
clr.l 8(a1,d6.W)
clr.l 12(a1,d6.W)
bsr.L zufall
clr.l 8(a2,d6.W)
bsr.S zufall
and.l #$00030000,d0
add.l #$009e0000,d0
move.l d0,0(a2,d6.W)
bsr.S zufall
and.l #$00030000,d0
add.l #$00620000,d0
move.l d0,4(a2,d6.W)
bsr.S zufall
and.l #$ffff,d0
move.l d0,20(a2,d6.W)
bsr.S zufall
and.l #$ffff,d0
move.l d0,24(a2,d6.W)
bsr.S zufall
move.l d0,20(a1,d6.W)
bra.L new_position
compute_adress:
lea bitplane,a0
clr.l d1
move.l 0(a2,d6.W),d0
swap d0
move.w d0,d1
and.l #7,d0
eor.w #7,d0
divu #8,d1
move.l 4(a2,d6.W),d2
swap d2
and.l #$ff,d2
mulu #$28,d2
add.w d2,d1
add.w d1,a0
rts
zufall: move.l rnd1(pc),a3
move.l (a3),d0
add.l #$5000,a3
move.l (a3),d1
eor.l d1,d0
move.l rnd2(pc),d1
add.l #$42f54f32,d0
eor.l d1,d0
add.w $dff006,d0
eor.l #$dff006,d0
move.l d0,rnd2
add.l #2,rnd1
rts
adder:
dc.l 0
rnd1: dc.l 0
rnd2: dc.l 0
CMPundCOLOR:
dc.l $000c0000,$00180000,$00240000,$00300000,$003c0000,$00480000
dc.l $00540000,$00600000,$006c0000,$00780000,$00840000,$00900000
dc.l $009c0000,$00a80000,$00b40000,$00b80000
dc.l $00000001,$00000002,$00000003,$00000004,$00000005,$00000006
dc.l $00000007,$00000007,$00000007,$00000007,$00000007,$00000007
dc.l $00000008,$00000008,$00000008,$00000008
coplist:
dc.l $008e2c61,$0090ffc1,$00920038,$009400d0,$01003200,$01080000
dc.l $010a0000,$00e00006,$00e20000,$00e40006,$00e61f40,$00e80006
dc.l $00ea3e80,$01800000,$01820222,$01840444,$01860666,$01880999
dc.l $018a0bbb,$018c0ddd,$018e0fff
dc.l $fffffffe
pos_control: blk.l $1020,0
retter: blk.l $1020,0